package com.dlwx.parttimetalent.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.dlwx.parttimetalent.R;
import com.dlwx.parttimetalent.base.BaseActivity;
import com.dlwx.parttimetalent.comm.Constant;
import com.dlwx.parttimetalent.inter.DialogTwoBtnInter;
import com.dlwx.parttimetalent.utils.DialogUtils;
import com.dlwx.parttimetalent.utils.SPUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class ChooseSexActivity extends BaseActivity {

    @BindView(R.id.title_left_one_btn)
    ImageView titleLeftOneBtn;
    @BindView(R.id.ll_men)
    LinearLayout llMen;
    @BindView(R.id.ll_women)
    LinearLayout llWomen;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_choose_sex);
        ButterKnife.bind(this);
        initView();
    }

    private void initView() {
        titleLeftOneBtn.setVisibility(View.VISIBLE);


    }

    @OnClick({R.id.title_left_one_btn, R.id.ll_men, R.id.ll_women})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.title_left_one_btn:
                this.finish();
                break;
            case R.id.ll_men:
                DialogUtils.getMaterialDialogTwoBtn(this,"提示:","性别不可修改，请用真实性别，否则影响你提现！您注册的性别为：男",new DialogTwoBtnInter(){
                    @Override
                    public void confirm() {
                        SPUtils.put(ChooseSexActivity.this, Constant.SEX,"1");
                        startActivity(new Intent(ChooseSexActivity.this,SetNickNameActivity.class));
                    }
                    @Override
                    public void cancel() {}
                });
                break;
            case R.id.ll_women:
                DialogUtils.getMaterialDialogTwoBtn(this, "提示:", "性别不可修改，请用真实性别，否则影响你提现！您注册的性别为：女", new DialogTwoBtnInter() {
                    @Override
                    public void confirm() {
                        SPUtils.put(ChooseSexActivity.this, Constant.SEX,"2");
                        startActivity(new Intent(ChooseSexActivity.this,SetNickNameActivity.class));
                    }
                    @Override
                    public void cancel() {}
                });
                break;
        }
    }
}
